home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / BuildList.thor < prev    next >
Text File  |  1996-10-26  |  2KB  |  100 lines

  1. /* BuildList.thor by Troels Walsted Hansen
  2. ** $VER: BuildList.thor v2.00 (01.11.94)
  3. **
  4. ** An ARexx script that will make it easy to build a list
  5. ** of BBSs and conferences, for use with CrossPost.thor or
  6. ** MultiUpload.thor.
  7. **
  8. ** New: This version is only for THOR v2.0 or higher.
  9. */
  10.  
  11. options results
  12.  
  13. /* needs THOR and bbsread.library functions */
  14.  
  15. p = ' ' || address() || ' ' || show('P',,)
  16. thorport = pos(' THOR.',p)
  17.  
  18. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  19. else
  20. do
  21.     say 'No THOR port found!'
  22.     exit 10
  23. end
  24.  
  25. if ~show('p', 'BBSREAD') then
  26. do
  27.     address command
  28.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  29.         "WaitForPort BBSREAD"
  30. end
  31.  
  32. /* main stuff */
  33.  
  34. address(thorport)
  35. THORTOFRONT
  36. REQUESTNOTIFY TEXT '"Create new list or modify old one?"' BT '"_New|_Old"'
  37.  
  38. if(result = 0) then 
  39. do
  40.     REQUESTFILE TITLE '"Select CrossPost/MultiUpload list file:"' ID '"THOR:Rexx/PostingLists"' FP
  41.  
  42.     configfile = result
  43.     lastchar = right(configfile,1)
  44.     if(rc ~= 0 | lastchar = "/" | lastchar = ":" | configfile = "") then exit
  45.  
  46.     if exists(configfile) then
  47.     do
  48.         REQUESTNOTIFY TEXT '"File already exists. Append or overwrite?"' BT '"_Append|_Overwrite|_Cancel"'
  49.         if(result = 0) then exit
  50.         if(result = 1) then call open(cf, configfile, A)
  51.             if(result = 2) then call open(cf, configfile, W)
  52.     end
  53.     else call open(cf, configfile, W)
  54. end
  55. else
  56. do
  57.     REQUESTSTRING TITLE '"Enter name and full path of list:"' BT '"_Ok|_Cancel"' ID '"THOR:Rexx/PostingLists/"' MAXCHARS 256
  58.  
  59.     configfile = result
  60.     lastchar = right(configfile,1)
  61.     if(rc ~= 0 | lastchar = "/" | lastchar = ":" | configfile = "") then exit
  62.     else call open(cf, configfile, W)
  63. end
  64.  
  65. address(bbsread)
  66. GETBBSLIST stem BBSLIST
  67. if(rc ~= 0) then
  68. do
  69.     address(thorport)
  70.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  71.     exit 5
  72. end
  73.  
  74. address(thorport)
  75. REQUESTLIST instem BBSLIST outstem USERBBSLIST title '"Select BBSs:"' DRAGSELECT MULTISELECT SIZEGADGET
  76. if(rc ~= 0) then exit
  77.  
  78. do i=1 to USERBBSLIST.COUNT
  79.     address(bbsread)
  80.         GETCONFLIST '"'USERBBSLIST.i'"' CONFLIST
  81.     if(rc ~= 0) then
  82.     do
  83.         address(thorport)
  84.         REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  85.         exit 5
  86.     end
  87.  
  88.     address(thorport)
  89.     REQUESTLIST instem CONFLIST title '"Select conference at ' || USERBBSLIST.i || ':' || '"' SIZEGADGET
  90.     if(rc ~= 0) then confname = ""
  91.     else confname = result
  92.  
  93.     call writeln(cf, "------------------")
  94.     call writeln(cf, "BBS: "USERBBSLIST.i)
  95.     call writeln(cf, "Conf: "confname)
  96. end
  97.  
  98. call close(cf)
  99. exit
  100.